/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.unal.bioingenium.kbmed.util.system;

/**
 *
 * @author Alejandro Riveros Cruz
 */
public class Memory {

    private static long lastUsed;

    public static void showUsage(String label) {
        for (int i = 0; i < 10; i++) {
            System.gc();
        }
        long used = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
        System.out.format("%-10s used %10d, change of %+10d%n", label, used, used - lastUsed);
        lastUsed = used;
    }
}
